package vy.org.app.common;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.ResourceBundle;

public class MenuModelMapEnum extends BaseEnum {
	
	public static final MenuModelMapEnum HOME_PAGE_MENU = new MenuModelMapEnum(1,"HOME");

	public static final MenuModelMapEnum MEMBER_PAGE_MENU = new MenuModelMapEnum(2,"VY_MEMBER", 
			ModuleEnum.SEARCH_MEMBER.getId(),
			ModuleEnum.SEARCH_VIDHYARTHI.getId(),
			ModuleEnum.ADD_MEMBER.getId(),
			ModuleEnum.EDIT_MEMBER.getId(),
			ModuleEnum.DELETE_MEMBER.getId(),
			ModuleEnum.ADD_VIDHYARTHI.getId(),
			ModuleEnum.EDIT_VIDHYARTHI.getId(),
			ModuleEnum.DELETE_VIDHYARTHI.getId(),
			ModuleEnum.SEARCH_EMPLOYEE.getId(), 
			ModuleEnum.ADD_EMPLOYEE.getId(), 
			ModuleEnum.EDIT_EMPLOYEE.getId(), 
			ModuleEnum.DELETE_EMPLOYEE.getId());
	
	public static final MenuModelMapEnum SUBSCRIPTION_PAGE_MENU = new MenuModelMapEnum(3,"SUBSCRIPTION", 
			ModuleEnum.SEARCH_SUBSCRIPTION.getId(),
			ModuleEnum.SEARCH_PATRA.getId(),
			ModuleEnum.MNTN_PRINT_LABEL_REPORT.getId(),
			ModuleEnum.RUN_PRINT_LABEL_REPORT.getId(),
			ModuleEnum.ADD_SUBSCRIPTION.getId(),
			ModuleEnum.EDIT_SUBSCRIPTION.getId(),
			ModuleEnum.DELETE_SUBSCRIPTION.getId(),
			ModuleEnum.ADD_PATRA.getId(),
			ModuleEnum.EDIT_PATRA.getId(),
			ModuleEnum.DELETE_PATRA.getId());

	public static final MenuModelMapEnum ASHRAM_PAGE_MENU = new MenuModelMapEnum(4,"ASHRAM", 
			ModuleEnum.SEARCH_ASHRAM.getId(),
			ModuleEnum.ADD_ASHRAM.getId(),
			ModuleEnum.EDIT_ASHRAM.getId(),
			ModuleEnum.DELETE_ASHRAM.getId());

	public static final MenuModelMapEnum SANT_SAMAJ_PAGE_MENU = new MenuModelMapEnum(5,"SANTSAMAJ", 
			ModuleEnum.SEARCH_SANTSAMAJ.getId(),
			ModuleEnum.SEARCH_SATSANG.getId(),
			ModuleEnum.ADD_SANTSAMAJ.getId(),
			ModuleEnum.EDIT_SATSANG.getId(),
			ModuleEnum.EDIT_SANTSAMAJ.getId(),
			ModuleEnum.ADD_SATSANG.getId(),
			ModuleEnum.DELETE_SANTSAMAJ.getId(),
			ModuleEnum.DELETE_SATSANG.getId());

	public static final MenuModelMapEnum ADMIN_PAGE_MENU = new MenuModelMapEnum(6,"ADMIN",
			ModuleEnum.ADVANCE_SEARCH.getId(),
			ModuleEnum.MAINTAIN_DESIGNATION.getId(), 
			ModuleEnum.MAINTAIN_CITIES.getId(), 
			ModuleEnum.MAINTAIN_DELIVERY_MODE.getId(),
			ModuleEnum.MAINTAIN_PATRIKA.getId(),
			ModuleEnum.MAINTAIN_PROFESSION.getId(),
			ModuleEnum.MAINTAIN_QUALIFICATION.getId(),
			ModuleEnum.MAINTAIN_RELIGION.getId(),
			ModuleEnum.MAINTAIN_RESPONSIBILITIES.getId(), 
			ModuleEnum.MAINTAIN_GROUP.getId(), 
			ModuleEnum.MAINTAIN_MODULES.getId(), 
			ModuleEnum.MAINTAIN_USER.getId(),
			ModuleEnum.BULK_UPLOAD.getId());

	MenuModelMapEnum(Integer menuId, String name, Integer... modules) {
		super(menuId,name);
		this.modules = Arrays.asList(modules);
	}
	
	public List<Integer> getModules(){
		return Collections.unmodifiableList(modules);
	}
	
	public boolean checkModule(Object name){
		return modules.contains(name);
	}

	public String getDisplayName() {
		return RESOURCE.getString(getName());
	}
	
	List<Integer> modules = null;

	private static final ResourceBundle RESOURCE = ResourceBundle.getBundle("ModuleResource");
}
